﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate;
using System.Xml;


namespace Jemgine.MapEditor
{
    internal class EditorStateInterface : Engine.EditorStateInterface
    {
        EditorState ES;
        internal EditorStateInterface(EditorState _es) { ES = _es; }

        #region EditorStateInterface Members

        public string WorkingDirectory()
        {
            return ES.Directory;
        }

        public Jemgine.Data.MapData ReadMap(String MapName)
        {

            XmlReader Reader = XmlReader.Create(MapName);
            var NewMap = IntermediateSerializer.Deserialize<Jemgine.Data.MapData>(Reader, MapName);
            Reader.Close();
            return NewMap;

        }

        #endregion
    }
}
